<?php
declare (strict_types = 1);

namespace app\api\controller;

use app\api\model\bargain;
use app\api\model\bargain_user;
use app\api\model\bargain_user_help;
use app\api\service\BargainService;
use app\BaseController;

class BargainController extends BaseController
{

    /**
     * Author:Su ang
     * 查询砍价活动列表
     */
    public function activityTime()
    {
      return  BargainService::activityTime();
    }

    /**
     * Author:Su ang
     * 首次选择商品砍价
     */
     public function bargain()
     {
         //获取好友用户ID
         $b_id = $this->request->get('uid');
         //获取砍价活动id
         $u_id = $this->request->get('bid');
      return BargainService::bargain($u_id,$b_id);
     }
    /**
     * Author:Su ang
     *  好友砍价
     */
     public function friend_bargain()
     {
        //获取好友分享的口令
       $spread_code = $this->request->get('code');
        //获取好友用户ID
       $uid = $this->request->get('uid');
     return  BargainService::time_bargain($spread_code,$uid);
   }
}
